import com.avaje.ebean.Ebean;
import models.Employe;
import org.h2.store.fs.FileUtils;
import play.Application;
import play.GlobalSettings;
import play.Logger;
import play.libs.Yaml;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by richard on 02/04/14.
 */
public class Global extends GlobalSettings {
    @Override
    public void onStart(Application app) {
        Logger.info("Application has started");
        this.initData();
    }

    @Override
    public void onStop(Application app) {
        Logger.info("Application shutdown...");
    }


    public static String createDdl = "";
    public static String dropDdl = "";
    public void resetData(){
       // A voir et a tester :
        //http://blog.matthieuguillermin.fr/2012/03/unit-testing-tricks-for-play-2-0-and-ebean/


    }
    public void initData(){
        //reset database
        /*this.resetData();


;

        Map all= (Map)Yaml.load("initial-data.yml");

        Logger.info(all.get("Employes") + " TEST " + all + "");
        Ebean.save((Collection)(all.get("Employes")));
*/
    }

}
